package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.YlMessageControlMapper;
import com.ruoyi.system.domain.YlMessageControl;
import com.ruoyi.system.service.IYlMessageControlService;

/**
 * 消息公告管理Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-02-18
 */
@Service
public class YlMessageControlServiceImpl implements IYlMessageControlService 
{
    @Autowired
    private YlMessageControlMapper ylMessageControlMapper;

    /**
     * 查询消息公告管理
     * 
     * @param messageId 消息公告管理主键
     * @return 消息公告管理
     */
    @Override
    public YlMessageControl selectYlMessageControlByMessageId(Long messageId)
    {
        return ylMessageControlMapper.selectYlMessageControlByMessageId(messageId);
    }

    /**
     * 查询消息公告管理列表
     * 
     * @param ylMessageControl 消息公告管理
     * @return 消息公告管理
     */
    @Override
    public List<YlMessageControl> selectYlMessageControlList(YlMessageControl ylMessageControl)
    {
        return ylMessageControlMapper.selectYlMessageControlList(ylMessageControl);
    }

    /**
     * 新增消息公告管理
     * 
     * @param ylMessageControl 消息公告管理
     * @return 结果
     */
    @Override
    public int insertYlMessageControl(YlMessageControl ylMessageControl)
    {
        ylMessageControl.setCreateTime(DateUtils.getNowDate());
        return ylMessageControlMapper.insertYlMessageControl(ylMessageControl);
    }

    /**
     * 修改消息公告管理
     * 
     * @param ylMessageControl 消息公告管理
     * @return 结果
     */
    @Override
    public int updateYlMessageControl(YlMessageControl ylMessageControl)
    {
        ylMessageControl.setUpdateTime(DateUtils.getNowDate());
        return ylMessageControlMapper.updateYlMessageControl(ylMessageControl);
    }

    /**
     * 批量删除消息公告管理
     * 
     * @param messageIds 需要删除的消息公告管理主键
     * @return 结果
     */
    @Override
    public int deleteYlMessageControlByMessageIds(Long[] messageIds)
    {
        return ylMessageControlMapper.deleteYlMessageControlByMessageIds(messageIds);
    }

    /**
     * 删除消息公告管理信息
     * 
     * @param messageId 消息公告管理主键
     * @return 结果
     */
    @Override
    public int deleteYlMessageControlByMessageId(Long messageId)
    {
        return ylMessageControlMapper.deleteYlMessageControlByMessageId(messageId);
    }
}
